package com.dengxian.usercenter.common.enums;

/**
 * 队伍状态枚举类
 */
public enum TeamStatusEnum {

    PUBLIC(0, "公开"),
    PRIVATE(1, "私有"),
    SECRET(2, "加密");


    private int value;

    private String text;

    public static TeamStatusEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        //先获取所有枚举值
        TeamStatusEnum[] values = TeamStatusEnum.values();
        //遍历所有枚举值
        for (TeamStatusEnum teamStatusEnum : values) {
            if (teamStatusEnum.getValue() == value) {
                return teamStatusEnum;
            }
        }
        return null;
    }

    //生成构造函数
    TeamStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    //这里不能用注解@daat，自己生成get和set方法
    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}




